<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery Mobile Web App</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link href="css/stylesheet.css" rel="stylesheet" type="text/css"/>
<link href="css/jq-mobile-green-button-theme.css" rel="stylesheet" type="text/css"/>
<link href="css/jq-mobile-red-button-theme.css" rel="stylesheet" type="text/css"/>

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
<!-- This reference to phonegap.js will allow for code hints as long as the current site has been configured as a mobile application. 
	 To configure the site as a mobile application, go to Site -> Mobile Applications -> Configure Application Framework... -->
<script src="js/phonegap.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {	
	$("#submit").click(function(){
		var formData = $("#loginForm").serialize();
		
		$.ajax({
			type: "POST",
			url: "login.php",
			cache: false,
			data: formData,
			success: onSuccess,
			error: onError
		});
		return false;
	});
});
function onSuccess(data, status){
	data = $.trim(data);
	if(data == '1'){
		document.location.href="intialsetup.php";
	}else if(data == "0"){
			document.location.href = "index.html";
	}else{
		$("#notification").html(data);
	}
}
function onError(data, status){
}
</script>
</head>
<body>
<div data-role="page" id="page" data-theme="c">
<div data-role="header" id="header" data-theme="a"> <h1>Match n' Rent </h1></div>
<div data-role="content">
<img src="images/mnr.png" />

	<form id="loginForm">
		
			<input type="text" name="username" id="username" value=""  data-theme="c" placeholder="Username" />
			<input type="password" name="password" id="password" value="" data-theme="c" placeholder="Password" />
		
		<h3 id="notification"></h3>
		
			<button id="submit" type="submit" data-icon="check" data-iconpos="right" data-theme="b" >Login</button>
		
	</form>
	<a href="forget.html" data-role="button" data-theme="e" data-icon="alert" data-iconpos="right" rel="external">Forgot your login?</a> 
	 <a href="register.html" data-role="button" data-theme="f" data-icon="delete" data-iconpos="right" rel="external"  >Not a member yet?</a>
</div></div>
</body>
</html>